let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n142,
                    i =
                    (this && this.__extends) ||
                    ((_n142 = function n(t, e) {
                            return (_n142 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n142(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        });
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.ScienceInfo = void 0);
                var r = t('AbsInfo'),
                    a = t('ScienceCfg'),
                    s = t('BagMrg'),
                    c = t('UmaSdkHelper'),
                    l = (function(t) {
                        function e(e, o) {
                            var n = t.call(this) || this;
                            return (
                                (n._maxLevel = 0),
                                n.init(a.ScienceCfg.ins.getDataByTypeAndLevel(e, o)),
                                n
                            );
                        }
                        return (
                            i(e, t),
                            (e.prototype.init = function(e) {
                                if ((t.prototype.init.call(this, e), e)) {
                                    var o = a.ScienceCfg.ins.getDataByTypeAndLevel(
                                        this.type,
                                        this.level + 1
                                    );
                                    this._isMaxLevel = null == o;
                                }
                            }),
                            (e.prototype.upgrade = function() {
                                var t = this.level + 1;
                                if (
                                    t <= this.maxLevel &&
                                    s.BagMrg.ins.getCount(s.BagMrg.GOLD) >= this.money
                                ) {
                                    var e = a.ScienceCfg.ins.getDataByTypeAndLevel(this.type, t);
                                    if (e) {
                                        var o = this.money;
                                        this.init(e),
                                            s.BagMrg.ins.useItem(s.BagMrg.GOLD, o),
                                            this.emit(r.InfoEvent.LevelChanged),
                                            c.default.scienceUpgrade(e.type, e.level);
                                    }
                                }
                            }),
                            (e.prototype.setLevel = function(t) {
                                var e = a.ScienceCfg.ins.getDataByTypeAndLevel(
                                    this.type,
                                    t > 0 ? t : this.level + 1
                                );
                                e && (this.init(e), this.emit(r.InfoEvent.LevelChanged));
                            }),
                            Object.defineProperty(e.prototype, 'maxLevel', {
                                get: function get() {
                                    return this._maxLevel;
                                },
                                set: function set(t) {
                                    (this._maxLevel = t),
                                    this._maxLevel > 0 && 0 == this.level && this.setLevel(1);
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            (e.prototype.checkRedDotState = function(t) {
                                this.maxLevel > 0 && !this.isMaxLevel ?
                                    t >= this.money && this.level < this.maxLevel ?
                                    this._redDotState ||
                                    ((this._redDotState = !0),
                                        this.emit(r.InfoEvent.RedDotStateChanged)) :
                                    this._redDotState &&
                                    ((this._redDotState = !1),
                                        this.emit(r.InfoEvent.RedDotStateChanged)) :
                                    ((this._redDotState = !1),
                                        this.emit(r.InfoEvent.RedDotStateChanged));
                            }),
                            Object.defineProperty(e.prototype, 'redDotState', {
                                get: function get() {
                                    return this._redDotState;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'isMaxLevel', {
                                get: function get() {
                                    return this._isMaxLevel;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'id', {
                                get: function get() {
                                    return this.getCfgData('id');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'type', {
                                get: function get() {
                                    return this.getCfgData('type');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'level', {
                                get: function get() {
                                    return this.getCfgData('level');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'name', {
                                get: function get() {
                                    return this.getCfgData('name');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'title', {
                                get: function get() {
                                    return this.getCfgData('title');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'icon', {
                                get: function get() {
                                    return this.getCfgData('icon');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'money', {
                                get: function get() {
                                    return this.getCfgData('money');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'hp', {
                                get: function get() {
                                    return this.getCfgData('hp');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'atk', {
                                get: function get() {
                                    return this.getCfgData('atk');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'def', {
                                get: function get() {
                                    return this.getCfgData('def');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'crit', {
                                get: function get() {
                                    return this.getCfgData('crit');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'solid', {
                                get: function get() {
                                    return this.getCfgData('solid');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'hpPer', {
                                get: function get() {
                                    return this.getCfgData('hpPer');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'atkPer', {
                                get: function get() {
                                    return this.getCfgData('atkPer');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'defPer', {
                                get: function get() {
                                    return this.getCfgData('defPer');
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            e
                        );
                    })(r.default);
                (o.ScienceInfo = l), console.log("end");
            module.exports =  e.exports;